import request from '@/utils/request'

/**
 * 获取维修记录信息
 * @param id
 * @return Promise
 */
export const getRecordInfoAPI = (id) => {
  return request({
    url: `/common/record/${id}`
  })
}

/**
 * 提交维修记录
 * @param {Object} data: {repair_request_id：报修单id, phone: 完工照片, remark：备注}
 * @return Promise
 */
export const addRecordInfoAPI = (data) => {
  return request({
    url: '/reception/repair/record/',
    method: 'POST',
    data
  })
}

/**
 * 修改维修记录信息
 * @param {Object} data: {id, repair_request_id：报修单id, phone: 完工照片, remark：备注}
 * @return Promise
 */
export const updateRecordInfoAPI = (data) => {
  return request({
    url: '/reception/repair/record/',
    method: 'PATCH',
    data
  })
}
